
// =================================================================== 
// class description : 
// =================================================================== 
// File: User.cs
// Copyright  @ AC
// History:
// 		2012/7/26  created by 
// 
// =================================================================== 
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;

namespace InternalManagementSystem.DAO.Models
{
	/// <summary>
	///
	/// </summary>
    public class Staff
	{
		#region Private Variables
		
		private System.Int32 _userID ;
		
		private System.String _userName= string.Empty;
		
		private System.Int32 _companyID;
		
		private System.Int32 _sex;
		
		private System.String _workType= string.Empty;

        private System.String _credential = string.Empty;

        private System.String _iDCard = string.Empty;
		
		private System.Int32 _isSafetyEducation;
		
		private System.Int32 _isAutoDeductPoints;
		
		private System.Int32 _autoDeductPeriod;
		
		private System.Int32 _autoDeductPoints;
		
		private System.DateTime _autoDeductDate = DateTime.MinValue;
		
		private System.Int32 _isAutoRecharge;

        private System.Int32 _isFine;

		private System.Int32 _currentIntegral;
		
		private System.Int32 _roleID;
		
		private System.Int32 _userTypeID;

        private System.String _password = string.Empty;
		
		
		#endregion
		
		#region Constructors
		
	    public Staff()
		{
		}
		
		public Staff(System.Int32 userID)
		{
			_userID = userID;
	
		}
		
		public Staff(bool populateDefaultValue) : this()
		{
			if(populateDefaultValue)
			{
				_userID = 0;
				_userName = string.Empty;
				_companyID = 0;
				_sex = 0;
				_workType = string.Empty;
				_credential = string.Empty;
				_iDCard = string.Empty;
				_isSafetyEducation = 0;
				_isAutoDeductPoints = 0;
				_autoDeductPeriod = 0;
				_autoDeductPoints = 0;
				_autoDeductDate = DateTime.MinValue;
				_isAutoRecharge = 0;
				_currentIntegral = 0;
				_roleID = 0;
				_userTypeID = 0;
				_password = string.Empty;
			}
		}
		
		public Staff(
			System.Int32 userID,
			System.String userName,
			System.Int32 companyID,
			System.Int32 sex,
			System.String workType,
			System.String credential,
			System.String iDCard,
			System.Int32 isSafetyEducation,
			System.Int32 isAutoDeductPoints,
			System.Int32 autoDeductPeriod,
			System.Int32 autoDeductPoints,
			System.DateTime autoDeductDate,
			System.Int32 isAutoRecharge,
			System.Int32 currentIntegral,
			System.Int32 roleID,
			System.Int32 userTypeID,
			System.String password
		)
		{
			_userID = userID;
			_userName = userName;
			_companyID = companyID;
			_sex = sex;
			_workType = workType;
			_credential = credential;
			_iDCard = iDCard;
			_isSafetyEducation = isSafetyEducation;
			_isAutoDeductPoints = isAutoDeductPoints;
			_autoDeductPeriod = autoDeductPeriod;
			_autoDeductPoints = autoDeductPoints;
			_autoDeductDate = autoDeductDate;
			_isAutoRecharge = isAutoRecharge;
			_currentIntegral = currentIntegral;
			_roleID = roleID;
			_userTypeID = userTypeID;
			_password = password;
			
		}
		
		#endregion
		
		#region Properties
		
		public System.Int32 UserID
		{
			get {return _userID;}
			set {_userID = value;}
		}
		
		public System.String UserName
		{
			get {return _userName;}
			set {_userName = value;}
		}
		
		public System.Int32 CompanyID
		{
			get {return _companyID;}
			set {_companyID = value;}
		}
		
		public System.Int32 Sex
		{
			get {return _sex;}
			set {_sex = value;}
		}
		
		public System.String WorkType
		{
			get {return _workType;}
			set {_workType = value;}
		}
		
		public System.String Credential
		{
			get {return _credential;}
			set {_credential = value;}
		}
		
		public System.String IDCard
		{
			get {return _iDCard;}
			set {_iDCard = value;}
		}
		
		public System.Int32 IsSafetyEducation
		{
			get {return _isSafetyEducation;}
			set {_isSafetyEducation = value;}
		}
		
		public System.Int32 IsAutoDeductPoints
		{
			get {return _isAutoDeductPoints;}
			set {_isAutoDeductPoints = value;}
		}
		
		public System.Int32 AutoDeductPeriod
		{
			get {return _autoDeductPeriod;}
			set {_autoDeductPeriod = value;}
		}
		
		public System.Int32 AutoDeductPoints
		{
			get {return _autoDeductPoints;}
			set {_autoDeductPoints = value;}
		}
		
		public System.DateTime AutoDeductDate
		{
			get {return _autoDeductDate;}
			set {_autoDeductDate = value;}
		}
		
		public System.Int32 IsAutoRecharge
		{
			get {return _isAutoRecharge;}
			set {_isAutoRecharge = value;}
		}
		
		public System.Int32 CurrentIntegral
		{
			get {return _currentIntegral;}
			set {_currentIntegral = value;}
		}
		
		public System.Int32 RoleID
		{
			get {return _roleID;}
			set {_roleID = value;}
		}
		
		public System.Int32 UserTypeID
		{
			get {return _userTypeID;}
			set {_userTypeID = value;}
		}
        public System.Int32 IsFine
		{
            get { return _isFine; }
            set { _isFine = value; }
		}
		public System.String Password
		{
			get {return _password;}
			set {_password = value;}
		}
		
		#endregion
	}
	
	/// <summary>
	/// 
	/// </summary>
    public class UserCollection : CollectionBase
	{
		public Staff this[int index]
        {
            get
            {
                return ((Staff)(List[index]));
            }
            set
            {
                List[index] = value;
            }
        }

        public void Add(Staff item)
        {
            if ((item == null))
            {
                throw new System.Exception("can't add null into collection");
            }
            else
            {
                try
                {
                    List.Add(item);
                }
                catch (NotSupportedException ex)
                {
                    throw new System.Exception((ex.Message + ex.StackTrace));
                }
            }
        }
	}
}